package com.dykj.fireFighting.web;

import com.dykj.fireFighting.web.base.websocket.CommonWebSocket;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration;
import org.apache.shiro.spring.boot.autoconfigure.ShiroAutoConfiguration;
import org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@EnableDubbo
@EnableDiscoveryClient
@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class,
        ShiroAnnotationProcessorAutoConfiguration.class,
        ShiroAutoConfiguration.class,
        ShiroBeanAutoConfiguration.class})
@EnableAspectJAutoProxy
public class FireFightingWebMonitoringCenterApplication {

    public static void main(String[] args) {
        //SpringApplication.run(FireFightingWebMonitoringCenterApplication.class, args);

        SpringApplication springApplication = new SpringApplication(FireFightingWebMonitoringCenterApplication.class);
        ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
        CommonWebSocket.setApplicationContext(configurableApplicationContext);//解决WebSocket不能注入的问题
    }

}
